package com.itheima.demo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//家电类
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Appliance implements Switch{

    //具体家电名称
    private String name;

    //状态：开或关
    private boolean status;   //默认是false

    @Override
    public void press() {

        //控制当前设备的开和关
        status = !status;
    }
}
